<!--aside-->
<template>
  <div class="aside_box">
    <div class="group">
      <el-button type="primary" size="small"> 新增 </el-button>
    </div>
    <el-menu
      :default-active="activeIndex"
      class="el-menu-demo"
      mode="vertical"
      @select="handleSelect"
    >
      <router-link
        v-for="(item, index) in tabList"
        :to="{ path: `/protocol/${item.path}` }"
        :key="index"
      >
        <el-menu-item :index="item.path">
          {{ item.name }}
        </el-menu-item>
      </router-link>
    </el-menu>
  </div>
</template>
<script>

export default {
  inject: ['reload'],
  data () {
    return {
      activeIndex: 'v1',
      tabList: [{ name: '用户协议', path: 'v1' }, { name: '充值协议', path: 'v2' }, { name: '隐私协议', path: 'v3' }, { name: '合作协议', path: 'v4' }]
    }
  },
  methods: {
    handleSelect (val) {
      this.reload()
    }
  }
}
</script>
<style lang="scss" scoped>
.aside_box {
  width: 180px;
  position: absolute;
  top: 0;
  bottom: 0;
  background-color: #f6f7fa;
  .group {
    padding: 12px 5px;
    text-align: center;
    border-bottom: 1px solid #cccccc;
  }
  .el-menu-demo {
    .el-menu-item {
      background-color: #f6f7fa;
      text-align: center;
    }
    .is-active {
      background-color: rgba(197, 198, 200, 1);
    }
  }
}
</style>